# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-hypothesmith
pkgver=0.2.3
pkgrel=2
pkgdesc="Hypothesis strategies for generating Python programs, something like CSmith"
url="https://github.com/Zac-HD/hypothesmith"
license=('MPL')
arch=('any')
depends=('python-hypothesis' 'python-lark-parser' 'python-libcst')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-black' 'python-parso' 'python-pytest')
source=("https://pypi.io/packages/source/h/hypothesmith/hypothesmith-$pkgver.tar.gz")
sha512sums=('effc9ba821c161d1464ca497c4b494e49fc447de3898884e77395caed380ba91b9742b88c93a2685238957dcb30642a96993ebfba25f1c14d2249d35395f44a7')

prepare() {
  cd hypothesmith-$pkgver
  sed -e '/--cov/d' -i tox.ini
}

build() {
  cd hypothesmith-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd hypothesmith-$pkgver
  PYTHONPATH="$PWD/build/lib" pytest -v
}

package() {
  cd hypothesmith-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
